#include <windows.h>
#include <stdio.h>

#define NOME_DO_SERVICO "Scrabble"

int main(int argc, char* argv[])
{
	SC_HANDLE schSCManager,schService;
	schSCManager = OpenSCManager( 
		NULL,                    // local machine 
		NULL,                    // ServicesActive database 
		SC_MANAGER_ALL_ACCESS);  // full access rights 
 
	if (schSCManager == NULL) 
		printf("Erro: OpenSCManager\n"); 

    schService = OpenService( 
        schSCManager,       // SCManager database 
        NOME_DO_SERVICO,       // name of service 
        DELETE);            // only need DELETE access 
 
    if (schService == NULL) 
        printf("Error: OpenService\n"); 
 
    if (! DeleteService(schService) ) 
        printf("Error: DeleteService\n"); 
    else 
        printf("DeleteService SUCCESS\n"); 
 
    CloseServiceHandle(schService); 
    CloseServiceHandle(schSCManager); 

 	return 0;
}

